import { getStoreId } from '@/utils'
import request from '@/utils/request'

/**
 * 车辆详情接口
 * @param {*} id 
 */
export function getClientCarById(id) {
  return request.get(`/clientCar/detail/${id}`)
}

export function addClient(param) {
  return request.post('/clientCar/save', param)
}

/**
 * 车辆修改接口
 * @param {*} param 
 */
export function editClient(param) {
  return request.put('/clientCar/save', param)
}



/**
 * 删除车辆
 * @param {*} id 
 */
export function deleteClientCar(id) {
  return request.delete(`/clientCar/del/${id}`)
}

/**
 * 车辆管理
 * @param {*} param 
 * @param {*} pageSize 
 * @param {*} pageNo 
 */
export function clientCarList(param, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    param: {
      ...param
    }
  }
  return request.post('/clientCar/page', data)
}

export function editClientCarDetail(id, param) {
  return request.get(`/clientCar/findById/${id}`, param)
}

/**
 * 获取当前门店下保险到期的客户
 */
export function getfindClientIds() {
  return request.get(`/clientCar/findClientIds/${getStoreId()}`)
}

